DEF_PROJECT=../../..
include $(DEF_PROJECT)/scripts/main.mk
name=udev
version=182
version=174
prefix=/usr
destdir=$(DIR_SYSROOT)
deps=util-linux
extdeps=eglibc-tools gcc-tools binutils-tools linux-header-tools

DL_SERV=http
DL_HOST=www.kernel.org
DL_PATH=pub/linux/utils/kernel/hotplug
DL_SUFFIX=tar.bz2

CFLAGS+=-I$(destdir)/usr/include
LDFLAGS+=-L$(destdir)/usr/lib

cdefs+=PKG_CONFIG_PATH=$(destdir)/usr/lib/pkgconfig

cflags+=--host=$(CC_TARGET)
cflags+=--build=$(CC_HOST)
cflags+=--exec-prefix=""
cflags+=--libexecdir=/lib/udev
cflags+=--sbindir=/sbin
cflags+=--libdir=$(prefix)/lib
cflags+=--disable-extras
cflags+=--disable-gudev
cflags+=--disable-introspection
cflags+=--with-pci-ids-path=/usr/share/hwdata/pci.ids
cflags+=--with-usb-ids-path=/usr/share/hwdata/usb.ids

pre-build:
	sed -i 's#/usr/lib/libuuid.la#$(destdir)/usr/lib/libuuid.la#' $(destdir)/usr/lib/libblkid.la
	cd $<;$(cdefs) ./configure $(cflags)

post-build:
	$(MAKE) -C $(if $(build),$(build),$(source)) $(iflags)
	install -dv $(destdir)/lib/firmware
	mv $(destdir)/lib/udev/udevd $(destdir)/sbin/
